Optimal. Leaf size=58 \[ \frac{\left (a^2+b^2\right ) \sin (c+d x)}{d}-\frac{a^2 \sin ^3(c+d x)}{3 d}+\frac{a b \sin (c+d x) \cos (c+d x)}{d}+a b x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.089153, antiderivative size = 58, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.238, Rules used = {3788, 2635, 8, 4044, 3013} \[ \frac{\left (a^2+b^2\right ) \sin (c+d x)}{d}-\frac{a^2 \sin ^3(c+d x)}{3 d}+\frac{a b \sin (c+d x) \cos (c+d x)}{d}+a b x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3788
Rule 2635
Rule 8
Rule 4044
Rule 3013
Rubi steps
\begin{align*} \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \, dx &=(2 a b) \int \cos ^2(c+d x) \, dx+\int \cos ^3(c+d x) \left (a^2+b^2 \sec ^2(c+d x)\right ) \, dx\\ &=\frac{a b \cos (c+d x) \sin (c+d x)}{d}+(a b) \int 1 \, dx+\int \cos (c+d x) \left (b^2+a^2 \cos ^2(c+d x)\right ) \, dx\\ &=a b x+\frac{a b \cos (c+d x) \sin (c+d x)}{d}-\frac{\operatorname{Subst}\left (\int \left (a^2+b^2-a^2 x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=a b x+\frac{\left (a^2+b^2\right ) \sin (c+d x)}{d}+\frac{a b \cos (c+d x) \sin (c+d x)}{d}-\frac{a^2 \sin ^3(c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.168356, size = 59, normalized size = 1.02 \[ \frac{3 \left (3 a^2+4 b^2\right ) \sin (c+d x)+a (a \sin (3 (c+d x))+12 b (c+d x)+6 b \sin (2 (c+d x)))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.051, size = 63, normalized size = 1.1 \begin{align*}{\frac{1}{d} \left ({\frac{{a}^{2} \left ( \left ( \cos \left ( dx+c \right ) \right ) ^{2}+2 \right ) \sin \left ( dx+c \right ) }{3}}+2\,ab \left ( 1/2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) +1/2\,dx+c/2 \right ) +{b}^{2}\sin \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.0886, size = 81, normalized size = 1.4 \begin{align*} -\frac{2 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{2} - 3 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a b - 6 \, b^{2} \sin \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.6223, size = 124, normalized size = 2.14 \begin{align*} \frac{3 \, a b d x +{\left (a^{2} \cos \left (d x + c\right )^{2} + 3 \, a b \cos \left (d x + c\right ) + 2 \, a^{2} + 3 \, b^{2}\right )} \sin \left (d x + c\right )}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.24984, size = 207, normalized size = 3.57 \begin{align*} \frac{3 \,{\left (d x + c\right )} a b + \frac{2 \,{\left (3 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 3 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 3 \, b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 2 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 6 \, b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 3 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 3 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 3 \, b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{3}}}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]